home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Developer Utilities / Installer 4.0GM SDK / Script Examples / Version Compare / File Version Compare / Creation Date & Version Compare / Simple Compare.r < prev    next >
Encoding:
Text File  |  1994-02-10  |  3.4 KB  |  151 lines  |  [TEXT/MPS ]

  1. #include "InstallerTypes.r"
  2.  
  3. //  The "creation date compare" is set up to use the standard old way of determining
  4. //  whether or not to replace/update an existing file from the creation date.
  5. //  This is the recommended way of updating files which do not have any version
  6. //  information within the file.
  7.  
  8. //  If the correct flags are set, Installer will compare the creation date of
  9. //  the existing target file with the creation date hard-coded in the 'infs'
  10. //  of the source file.  (Be sure that the 'incd' contains the creation date
  11. //  of the Install Script, in case the Finder readjusts the source file's 
  12. //  creation date.
  13.  
  14. //  The following flags must be set:
  15. //        copy, useSrcCrDateToCompare, leaveAloneIfNewer, & update existing.
  16. //  also the 'infs' for the source file must have the creation date hard coded.
  17.  
  18.  
  19.  
  20.  
  21. //  The "default version compare" is set up to use the standard new way of
  22. //  determining whether or not to replace/update an existing file from the
  23. //  file's 'vers' 1 resource. This is the recommended way of determining whether
  24. //  or not to update an existing file.
  25.  
  26. //  If the correct flags are set, Installer will compare the 'vers' 1 resource
  27. //  the existing target file with the version hard-coded in the 'infa'
  28. //  of the source file.
  29.  
  30. //  The following flags must be set:
  31. //        copy, useSrcCrDateToCompare, leaveAloneIfNewer, & update existing.
  32. //  also the 'infa' must have the source version hard-coded in BCD format.
  33.  
  34.  
  35.  
  36.  
  37. resource 'inpk' (100) {
  38.     format0 {
  39.         showsOnCustom,
  40.         removable,
  41.         dontForceRestart,
  42.         0,
  43.         0,
  44.         "Copy File Read Me with old creation date compare....",
  45.         {    'infa', 1000    },
  46.         }
  47.     };
  48.  
  49. resource 'inpk' (200) {
  50.     format0 {
  51.         showsOnCustom,
  52.         removable,
  53.         dontForceRestart,
  54.         0,
  55.         0,
  56.         "Copy File TeachText with default version compare....",
  57.         {    'infa', 2000    },
  58.         }
  59.     };
  60.  
  61. resource 'infa' (1000) {
  62.     format1 {
  63.         deleteWhenRemoving,
  64.         deleteWhenInstalling,
  65.         copy,                            //  Copy on Install
  66.         dontIgnoreLockedFile,
  67.         dontSetFileLocked,
  68.         useSrcCrDateToCompare,            //  Use creation date for compare
  69.         srcNeedExist,
  70.         rsrcForkInRsrcFork,
  71.         leaveAloneIfNewer,                //  Do not update a newer file
  72.         updateExisting,                    //  Update an existing file
  73.         copyIfNewOrUpdate,
  74.         rsrcFork,
  75.         dataFork,
  76.         0,
  77.         0x0,
  78.         10000,
  79.         {    20000, 0, 0    },
  80.         0x0,
  81.         0,
  82.         0,
  83.         "Read Me"
  84.         }
  85.     };
  86.  
  87. resource 'infa' (2000) {
  88.     format1 {
  89.         deleteWhenRemoving,
  90.         deleteWhenInstalling,
  91.         copy,                            //  Copy on Install
  92.         dontIgnoreLockedFile,
  93.         dontSetFileLocked,
  94.         useVersProcToCompare,            //  Use creation date for compare
  95.         srcNeedExist,
  96.         rsrcForkInRsrcFork,
  97.         leaveAloneIfNewer,                //  Do not update a newer file
  98.         updateExisting,                    //  Update an existing file
  99.         copyIfNewOrUpdate,
  100.         rsrcFork,
  101.         dataFork,
  102.         0,
  103.         0x0,
  104.         30000,
  105.         {    31000, 0, 0    },
  106.         0,                                //  The source version number in BCD format
  107.         0,                                //  MUST be zero to use default version compare
  108.         0,
  109.         "TeachText"
  110.         }
  111.     };
  112.  
  113. resource 'infs' (10000) {
  114.     'ttro',
  115.     'ttxt',
  116.     0x0,
  117.     noSearchForFile,
  118.     TypeCrMustMatch,
  119.     ":Read Me"
  120.     };
  121.  
  122. resource 'infs' (20000) {
  123.     'ttro',
  124.     'ttxt',
  125.     0x1,
  126.     noSearchForFile,
  127.     TypeCrMustMatch,
  128.     "Tidbits:Apple Utilities:Read Me"    //  System 7.1 Tidbits FDHD diskette
  129.     };
  130.  
  131.  
  132.  
  133.  
  134. resource 'infs' (30000) {
  135.     'APPL',
  136.     'ttxt',
  137.     0x0,
  138.     noSearchForFile,
  139.     TypeCrMustMatch,
  140.     ":TeachText"
  141.     };
  142.  
  143. resource 'infs' (31000) {
  144.     'APPL',
  145.     'ttxt',
  146.     0x1,
  147.     noSearchForFile,
  148.     TypeCrMustMatch,
  149.     "Tidbits:Apple Utilities:TeachText"    //  System 7.1 Tidbits FDHD diskette
  150.     };
  151.